#include "BossData.h"

void  BossData::initSprite()
{
	sprites = new Sprites(rect);

	sprites->addSprite(STATE_MAP_STATE1_BOSS_GUN_TOP_LEFT, _ID_ARMY_BOSS_TOP_LEFT_1, 40);
	sprites->addSprite(STATE_MAP_STATE1_BOSS_GUN_TOP_RIGHT, _ID_ARMY_BOSS_TOP_RIGHT_1, 40);
	sprites->addSprite(STATE_MAP_STATE1_BOSS_GUN_BOTTOM, _ID_ARMY_BOSS_BOTTOM_1, 40);

	sprites->setState(_ID_ARMY_BOSS_TOP_LEFT_1);

	this->initSubRect();
}

BossData::BossData(int id, int type, double x, double y, int state)
{
	this->id = id;
	this->type = type;

	switch (state)
	{
	case STATE_MAP_STATE1_BOSS_GUN_TOP_LEFT:
		this->rect = new Rect(_POSITION_TOP_LEFT_X, _POSITION_TOP_LEFT_Y, _OBS_BOSS_TOP_LEFT_1_HEGHT, _OBS_BOSS_TOP_LEFT_1_WIDTH);
		break;
	case STATE_MAP_STATE1_BOSS_GUN_TOP_RIGHT:
		this->rect = new Rect(_POSITION_TOP_RIGHT_X, _POSITION_TOP_RIGHT_Y, _OBS_BOSS_TOP_RIGHT_1_HEIGHT, _OBS_BOSS_TOP_RIGHT_1_WIDTH);
		break;
	case STATE_MAP_STATE1_BOSS_GUN_BOTTOM:
		this->rect = new Rect(_POSITION_BOTTOM_X, _POSITION_BOTTOM_Y, _OBS_BOSS_BOTTOM_1_HEIGHT, _OBS_BOSS_BOTTOM_1_WIDTH);
		break;
	default:
		this->rect = new Rect(x, y, 386, 219);
		break;
	}
	this->rect->Vx = this->rect->Vy = 0;

	this->initData();

	switch (state)
	{
	case STATE_MAP_STATE1_BOSS_GUN_TOP_LEFT:
		sprites->setState(STATE_MAP_STATE1_BOSS_GUN_TOP_LEFT);
		break;
	case STATE_MAP_STATE1_BOSS_GUN_TOP_RIGHT:
		sprites->setState(STATE_MAP_STATE1_BOSS_GUN_TOP_RIGHT);
		break;
	case STATE_MAP_STATE1_BOSS_GUN_BOTTOM:
		sprites->setState(STATE_MAP_STATE1_BOSS_GUN_BOTTOM);
		break;
	default:
		sprites->setState(STATE_MAP_STATE1_BOSS_GUN_TOP_LEFT);
		break;
	}


}

void BossData::initSpriteHandler(LPD3DXSPRITE spritehandler)
{
	sprites->initSpriteHandler(spritehandler);
}

void BossData::initData()
{
	this->initSprite();
}

BossData::~BossData()
{

}